package skill;

import java.util.Arrays;

//出现的多数元素
public class leetcode169 {
    public static void main(String[] args) {
        int[] nums = {3,2,3};
        System.out.print(majorityElement(nums));
    }

    public static int majorityElement(int[] nums){
        Arrays.sort(nums);
        int p = (int) Math.floor(nums.length/2.0);
        return nums[p];
    }
}